package com.controller;

import com.biz.IOrder_detailBiz;
import com.biz.IOrdersBiz;
import com.entity.Order_detail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/detail")
public class OrderdetailAction {

    @Autowired
    private IOrder_detailBiz biz;

    @Autowired
    private IOrdersBiz ordersBiz;

    public IOrder_detailBiz getBiz() {
        return biz;
    }

    public void setBiz(IOrder_detailBiz biz) {
        this.biz = biz;
    }


    //后端列表
    @RequestMapping("/list")
    public String getAll(HttpSession session)
    {
       List<Order_detail> list= biz.getAll();
       session.setAttribute("detlist",list);
       return "/back/order_det_list";
    }


    //增加
    @RequestMapping("/add")
    public String add(Order_detail det)
    {
        biz.add_order_detail(det);
        return "redirect:list.action";
    }


}
